const state = {
	sex: '',
	grade: '',
	deptId: '',
	dept: '',
	majorId: '',
	major: '',
	clazz: ''
}

const mutations = {
	SET_SEX: (state, data) => {
		state.sex = data
	},
	SET_GRADE: (state, data) => {
		state.grade = data
	},
	SET_DEPTID: (state, data) => {
		state.deptId = data
	},
	SET_DEPT: (state, data) => {
		state.dept = data
	},
	SET_MAJORID: (state, data) => {
		state.majorId = data
	},
	SET_MAJOR: (state, data) => {
		state.major = data
	},
	SET_CLAZZ: (state, data) => {
		state.clazz = data
	}
}

const actions = {
	storeStudentInfo: ({ commit }, data) => {
		console.log(data);
		const { sex, grade, deptId, dept, majorId, major, clazz } = data
		commit('SET_SEX', sex)
		commit('SET_GRADE', grade)
		commit('SET_DEPTID', deptId)
		commit('SET_DEPT', dept)
		commit('SET_MAJORID', majorId)
		commit('SET_MAJOR', major)
		commit('SET_CLAZZ', clazz)
	}
}

const student = {
	state,
	mutations,
	actions
}

export default student